package com.java.IO.object_stream;

import java.io.Serializable;

public class Student implements Serializable {
    // 序列号
    private static final long serialVersionUID = -6357601841556449654L;
    
    private String name;
    private transient int age;
    private Sex sex;
    
    public Student(String name, int age, Sex sex) {
        this.name = name;
        this.age = age;
        this.sex = sex;
    }
    
    enum Sex {
        BOY("男"), GIRL("女");
        
        private String name;
        
        Sex(String name) {this.name = name;}
    }
    
    @Override
    public String toString() {
        return name + '-' + age + '-' + sex.name;
    }
}
